/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package nl.hanze.shoestring.domain;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author alex
 */
@Entity
@Table(name = "groepskorting")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Groepskorting.findAll", query = "SELECT g FROM Groepskorting g"),
    @NamedQuery(name = "Groepskorting.findById", query = "SELECT g FROM Groepskorting g WHERE g.id = :id"),
    @NamedQuery(name = "Groepskorting.findByVan", query = "SELECT g FROM Groepskorting g WHERE g.van = :van"),
    @NamedQuery(name = "Groepskorting.findByTot", query = "SELECT g FROM Groepskorting g WHERE g.tot = :tot"),
    @NamedQuery(name = "Groepskorting.findByKorting", query = "SELECT g FROM Groepskorting g WHERE g.korting = :korting")})
public class Groepskorting implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "van")
    private int van;
    @Basic(optional = false)
    @NotNull
    @Column(name = "tot")
    private int tot;
    @Basic(optional = false)
    @NotNull
    @Column(name = "korting")
    private float korting;

    public Groepskorting() {
    }

    public Groepskorting(Integer id) {
        this.id = id;
    }

    public Groepskorting(Integer id, int van, int tot, float korting) {
        this.id = id;
        this.van = van;
        this.tot = tot;
        this.korting = korting;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getVan() {
        return van;
    }

    public void setVan(int van) {
        this.van = van;
    }

    public int getTot() {
        return tot;
    }

    public void setTot(int tot) {
        this.tot = tot;
    }

    public float getKorting() {
        return korting;
    }

    public void setKorting(float korting) {
        this.korting = korting;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Groepskorting)) {
            return false;
        }
        Groepskorting other = (Groepskorting) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "nl.hanze.shoestring.domain.Groepskorting[ id=" + id + " ]";
    }
    
}
